// !@#$McCaBe-InStRuMeNtAtIoN$#@!
// Instrumented with the McCabe Java Parser
// Version: 8.1.0.1 - 20110309
// Using Path Vector Instrumentation
// Date: Sun Apr 01 2012 20:37:58
package Driver;

import Model.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import com.mccabe.*;


class Facade_fd73d9250816925ad9e0d7fd374417da {
    static java.lang.Object info[];
    static {
        info = new java.lang.Object[2];
        info[0] = new Integer(-1);
        info[1] = new String("R:\\yu\\Concordia\\SOEN 344 Design II\\Term Assignment\\Code Repo\\trunk\\Iteration 3\\ERS\\src\\Driver\\Facade.java");
    }
}



/**
 * Emulates persistence and services requests from the Event Manager
 */
public class Facade 
{
	private static Catalog catalog;
	private static BookingManager manager;
	
	/**
	 * Emulates persistence
	 */
	public static void initializeAll()
	{
int _mcFreq_6e06c1d7afabf4228a7b093c5b035832[] = new int[4];
PathVec_ERS_Iter3.enterMethod(Facade_fd73d9250816925ad9e0d7fd374417da.info,0,_mcFreq_6e06c1d7afabf4228a7b093c5b035832,0);
		
		// Initialize catalog and booking managers
		catalog = new Catalog();
		manager = new BookingManager(catalog);
		
		// Create a few venues
		Venue venueHallBuilding = new Venue("Hall building", "1455 De Maisonneuve Blvd. W., Montreal, Quebec", 30);
		Venue venueAndrewsPub = new Venue("Andrew's Pub", "1239 Guy, Montreal, QC", 20);
		
		VenueTimeslot lectureTimeslot1 = new VenueTimeslot(venueHallBuilding);
		VenueTimeslot lectureTimeslot2 = new VenueTimeslot(venueHallBuilding);		
		
		VenueTimeslot rockTimeslot1 = new VenueTimeslot(venueAndrewsPub);
		VenueTimeslot rockTimeslot2 = new VenueTimeslot(venueAndrewsPub);	
		
		EventSpecification rockShowEventSpec = new EventSpecification("Rock show", true);
		EventSpecification soen344LectureEventSpec = new EventSpecification("Soen 344 Lecture", true);
		
		Event lectureEvent1 = null;
		Event lectureEvent2 = null;
		Event rockEvent1 = null;
		Event rockEvent2 = null;
		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
		
{boolean __MCCABE_SKIPNEXT_EVENT_6 = false;
try {try 
		{
			lectureEvent1 = new Event (dateFormat.parse("2012-04-12 13:15"), 75, venueHallBuilding.getCapacity(), soen344LectureEventSpec, EventStatus.Open, lectureTimeslot1);
			lectureEvent2 = new Event (dateFormat.parse("2012-04-14 14:30"), 75, venueHallBuilding.getCapacity(), soen344LectureEventSpec, EventStatus.Open, lectureTimeslot2);
			rockEvent1 = new Event (dateFormat.parse("2012-04-14 20:15"), 75, venueAndrewsPub.getCapacity(), rockShowEventSpec, EventStatus.Open, rockTimeslot1);
			rockEvent2 = new Event (dateFormat.parse("2012-04-17 22:30"), 75, venueAndrewsPub.getCapacity(), rockShowEventSpec, EventStatus.Open, rockTimeslot2);
		} 
		catch (ParseException e)
		{
PathVec_ERS_Iter3.decision(Facade_fd73d9250816925ad9e0d7fd374417da.info,0,_mcFreq_6e06c1d7afabf4228a7b093c5b035832,1,0,true);
__MCCABE_SKIPNEXT_EVENT_6 = true;

			Service.OutputManager.println("Can't parse event datetime");
			System.exit(0);
		}
if (!__MCCABE_SKIPNEXT_EVENT_6)

PathVec_ERS_Iter3.decision(Facade_fd73d9250816925ad9e0d7fd374417da.info,0,_mcFreq_6e06c1d7afabf4228a7b093c5b035832,3,0,true);
__MCCABE_SKIPNEXT_EVENT_6 = true;

} finally {
    if (!__MCCABE_SKIPNEXT_EVENT_6)
        PathVec_ERS_Iter3.decision(Facade_fd73d9250816925ad9e0d7fd374417da.info,0,_mcFreq_6e06c1d7afabf4228a7b093c5b035832,2,0,true);
}}

		catalog.getEvents().add(lectureEvent1);
		catalog.getEvents().add(lectureEvent2);
		catalog.getEvents().add(rockEvent1);
		catalog.getEvents().add(rockEvent2);
	}

	public static Catalog getCatalog() 
	{
int _mcFreq_c69058eee5c36654b1866569cd24e928[] = new int[1];
PathVec_ERS_Iter3.enterMethod(Facade_fd73d9250816925ad9e0d7fd374417da.info,1,_mcFreq_c69058eee5c36654b1866569cd24e928,0);

		return catalog;
	}

	public static void setCatalog(Catalog catalog) 
	{
int _mcFreq_d7b13d4a66052e6534e1bd56f1e21fa6[] = new int[1];
PathVec_ERS_Iter3.enterMethod(Facade_fd73d9250816925ad9e0d7fd374417da.info,2,_mcFreq_d7b13d4a66052e6534e1bd56f1e21fa6,0);

		Facade.catalog = catalog;
	}

	public static BookingManager getManager() 
	{
int _mcFreq_115bbc070e8c2aa4cad59221dd5b9d1a[] = new int[1];
PathVec_ERS_Iter3.enterMethod(Facade_fd73d9250816925ad9e0d7fd374417da.info,3,_mcFreq_115bbc070e8c2aa4cad59221dd5b9d1a,0);

		return manager;
	}

	public static void setManager(BookingManager manager) 
	{
int _mcFreq_d016e73d8d8c5ee48531c62b3d82b60a[] = new int[1];
PathVec_ERS_Iter3.enterMethod(Facade_fd73d9250816925ad9e0d7fd374417da.info,4,_mcFreq_d016e73d8d8c5ee48531c62b3d82b60a,0);

		Facade.manager = manager;
	}
}
